package com.ts.proj.repository;

import com.ts.base.repository.CommonRepository;
import com.ts.common.constant.SQLConstant;
import com.ts.proj.entity.MeasureEntity;
import com.ts.proj.vo.ReportVO;
import com.ts.util.PageData;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


//说明 字符串：，作为替换字符串 LOWERMeasure                Measure

public interface MeasureRepository extends CommonRepository<MeasureEntity> {

    @Query(value= " select SUM(t.tare) as tare ,SUM(t.gross_weight) as grossWeight ,SUM(t.suttle) as suttle from ta_measure t  where t.delete_flag = 'N' and t.close_symbol=1 and t.return_symbol=0   ",nativeQuery = true)
    List<PageData> sumByGroup();

    @Query(value =  SQLConstant.INREPORT,nativeQuery = true)
    List<PageData> reportInByMoveType(String customerName,String date,String month1,String mongth2);

    @Query(value =  SQLConstant.OUTREPORT,nativeQuery = true)
    List<PageData> reportOutByMoveType(String customerName,String date,String month1,String mongth2);


    @Query(value =  SQLConstant.YDINREPORT,nativeQuery = true)
    List<PageData> reportInByMoveTypeYD(String customerName,String date,String month1,String mongth2,String toDate);

    @Query(value =  SQLConstant.YDOUTREPORT,nativeQuery = true)
    List<PageData> reportOutByMoveType(String customerName,String date,String toDate,String month1,String mongth2);

    @Query(value =  SQLConstant.zcb,nativeQuery = true)
    List<PageData> zcb(Integer page,Integer size,String sql);

    @Query(value =  SQLConstant.zcbCount,nativeQuery = true)
    Integer zcbCount();

//    @Query(value= " select SUM(t.tare) as tare ,SUM(t.gross_weight) as grossWeight ,SUM(t.suttle) as suttle from ta_measure t  where t.delete_flag = 'N' and t.close_symbol=1 and t.return_symbol=0   ",nativeQuery = true)
//    List<PageData> monthSumGroup();





}